package net.tngou.action;

import java.io.IOException;
import java.util.Date;
import java.util.Random;

import net.tngou.enums.CookieEnum;
import net.tngou.util.CaptchaServiceSingleton;








/**
 * 显示验证码
 * @author 陈磊
 * @since 2012/2/9
 *
 */
public class CaptchaAction extends BaseAction {
	
	
	/**
	 * 显示验证码
	 */
	@Override
	public void execute() throws IOException  {
		String value=new Date().hashCode()+""+ new Random(100).nextInt();
		// TODO Auto-generated method stub
		response.addCookie(CookieEnum.tngou_captacha.toString(), value);
		CaptchaServiceSingleton.getInstance().writeCaptchaImage( request, response,session,value);
		    
	}
	

	

}
